package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.Role;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface RoleDao extends CrudRepository<Role,Integer> {

    //修改角色所处的部门
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update role_ set dept_id=?1 where jue_id=?2")
    public void updateJueseDeBuMen(Integer deptId,Integer jueId);
}
